package com.shortLinked.project.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.shortLinked.project.common.convention.result.Result;
import com.shortLinked.project.dto.req.ShortLinkCreateReqDTO;
import com.shortLinked.project.dto.resp.ShortLinkCreateRespDTO;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 后台短链接限流之后处理函数
 */
public class CustomBlockHandler {
    public static Result<ShortLinkCreateRespDTO> createShortLinkBlockHandlerMethod(
            @RequestBody ShortLinkCreateReqDTO requestParam, BlockException blockException) {
        return new Result<ShortLinkCreateRespDTO>()
                .setCode("B100000")
                .setMessage("当前接口访问人数过多，请稍后再尝试访问 ...");
    }
}
